﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using DataAccess;
using Microsoft.Practices.Unity;

namespace SilverlightRest.Web
{
    public class Bootstrapper
    {
        public static void Initialise()
        {
            var container = BuildUnityContainer();
            GlobalConfiguration.Configuration.DependencyResolver = new Unity.WebApi.UnityDependencyResolver(container);
        }

        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();

            // Repositories
            container.RegisterType<ISomeRepository, SomeRepository>();
            container.RegisterType<IUserRepository, UserRepository>();

            return container;

        }
    }
}